<?php
/**
 * @package    Joomla.Tutorials
 * @subpackage Components
 * @link http://docs.joomla.org/Developing_a_Model-View-Controller_Component_-_Part_4
 * @license    GNU/GPL
*/
 
// No direct access
 
defined( '_JEXEC' ) or die( 'Restricted access' );
 
// Require the base controller
 
require_once( JPATH_COMPONENT.DS.'controller.php' );
 
// Require specific controller if requested
if($controller = JRequest::getWord('controller')) {
    $path = JPATH_COMPONENT.DS.'controllers'.DS.$controller.'.php';
    if (file_exists($path)) {
        require_once $path;
    } else {
        $controller = '';
    }
}
$view = strtolower(JRequest::getVar('view')) ;
JSubMenuHelper::addEntry('Категории', 'index.php?option=com_shop&view=categories', ($view == 'categories') );
JSubMenuHelper::addEntry('Товары', 'index.php?option=com_shop&view=goods', ($view == 'goods') );
JSubMenuHelper::addEntry('Цены', 'index.php?option=com_shop&view=cost', ($view == 'cost') );
JSubMenuHelper::addEntry('Способы оплаты', 'index.php?option=com_shop&view=payment', ($view == 'payment') );
JSubMenuHelper::addEntry('Заказы', 'index.php?option=com_shop&view=orders', ($view == 'orders') );
JSubMenuHelper::addEntry('Товары на главной', 'index.php?option=com_shop&view=on_main', ($view == 'on_main') );
JSubMenuHelper::addEntry('Настройки', 'index.php?option=com_shop&view=settings', ($view == 'settings') );
JSubMenuHelper::addEntry('Настройки обновления', 'index.php?option=com_shop&view=update_settings', ($view == 'update_settings') );
JSubMenuHelper::addEntry('Обновление каталога', 'index.php?option=com_shop&view=price', ($view == 'price') );
JSubMenuHelper::addEntry('Ключевые слова', 'index.php?option=com_shop&view=keywords', ($view == 'keywords') );
// Create the controller
$classname    = 'ShopController'.$controller;
$controller   = new $classname( );
 
// Perform the Request task
$controller->execute( JRequest::getVar( 'task' ) );
 
// Redirect if set by the controller
$controller->redirect();
?>